iommu: Skip PASID validation for devices without PASID capability#238
Closed
tdavenvidia wants to merge 1 commit intoNVIDIA:linux-nvidia-6.12from
Closed
iommu: Skip PASID validation for devices without PASID capability#238tdavenvidia wants to merge 1 commit intoNVIDIA:linux-nvidia-6.12from
tdavenvidia wants to merge 1 commit intoNVIDIA:linux-nvidia-6.12from
Conversation
khfeng
suggested changes
Nov 11, 2025
Collaborator
khfeng
left a comment
There was a problem hiding this comment.
The content doesn't exactly match the upstream commit, so it should use "backported from" instead of "cherry picked from".
Generally PASID support requires ACS settings that usually create single device groups, but there are some niche cases where we can get multi-device groups and still have working PASID support. The primary issue is that PCI switches are not required to treat PASID tagged TLPs specially so appropriate ACS settings are required to route all TLPs to the host bridge if PASID is going to work properly. pci_enable_pasid() does check that each device that will use PASID has the proper ACS settings to achieve this routing. However, no-PASID devices can be combined with PASID capable devices within the same topology using non-uniform ACS settings. In this case the no-PASID devices may not have strict route to host ACS flags and end up being grouped with the PASID devices. This configuration fails to allow use of the PASID within the iommu core code which wrongly checks if the no-PASID device supports PASID. Fix this by ignoring no-PASID devices during the PASID validation. They will never issue a PASID TLP anyhow so they can be ignored. Fixes: c404f55 ("iommu: Validate the PASID in iommu_attach_device_pasid()") Cc: stable@vger.kernel.org (backported from commit b3f6fcd) Signed-off-by: Tushar Dave <tdave@nvidia.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Vasant Hegde <vasant.hegde@amd.com> Link: https://lore.kernel.org/r/20250520011937.3230557-1-tdave@nvidia.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
b12f44d to
4396cbe
Compare
Collaborator
Author
Done. Updated commit text to "backported from". |
Collaborator
|
LGTM |
nvmochs
approved these changes
Nov 11, 2025
Collaborator
nvmochs
left a comment
There was a problem hiding this comment.
Acked-by: Matthew R. Ochs <mochs@nvidia.com>
Collaborator
|
Merged, closing PR. |
arighi
reviewed
Nov 11, 2025
Collaborator
arighi
left a comment
There was a problem hiding this comment.
I usually like when there's a short line describing what changed from the original commit, unless it's just context adjustments, in this case we could add something like this:
[v6.12: updated set_dev_pasid() API, old domain argument added in v6.13]
But apart than that LGTM.
Acked-by: Andrea Righi arighi@nvidia.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generally PASID support requires ACS settings that usually create single device groups, but there are some niche cases where we can get multi-device groups and still have working PASID support. The primary issue is that PCI switches are not required to treat PASID tagged TLPs specially so appropriate ACS settings are required to route all TLPs to the host bridge if PASID is going to work properly.
pci_enable_pasid() does check that each device that will use PASID has the proper ACS settings to achieve this routing.
However, no-PASID devices can be combined with PASID capable devices within the same topology using non-uniform ACS settings. In this case the no-PASID devices may not have strict route to host ACS flags and end up being grouped with the PASID devices.
This configuration fails to allow use of the PASID within the iommu core code which wrongly checks if the no-PASID device supports PASID.
Fix this by ignoring no-PASID devices during the PASID validation. They will never issue a PASID TLP anyhow so they can be ignored.
Fixes: c404f55 ("iommu: Validate the PASID in iommu_attach_device_pasid()") Cc: stable@vger.kernel.org
(backported from commit b3f6fcd)
Reviewed-by: Lu Baolu baolu.lu@linux.intel.com
Reviewed-by: Vasant Hegde vasant.hegde@amd.com
Link: https://lore.kernel.org/r/20250520011937.3230557-1-tdave@nvidia.com